🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

call-bound

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

call-bound

Robust call-bound JavaScript intrinsics, using `call-bind` and `get-intrinsic`.

1.0.4
latest
Source
npm
Version published
Weekly downloads
33M
-4.91%
Maintainers
0
Weekly downloads
 
Created

What is call-bound?

The call-bound npm package is a utility that allows you to get a bound function for a method of an object, ensuring that the method is called with the correct 'this' context. This is particularly useful for methods that are often used in a standalone manner, such as array or string methods.

What are call-bound's main functionalities?

Binding a method to its object

This feature allows you to bind a method to its object, ensuring that the method is always called with the correct 'this' context. In this example, Array.prototype.slice is bound to an array, allowing it to be used as a standalone function.

const callBound = require('call-bound');
const arraySlice = callBound('Array.prototype.slice');
const result = arraySlice([1, 2, 3, 4], 1, 3); // [2, 3]

Other packages similar to call-bound

Keywords

javascript

FAQs

Package last updated on 03 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts